<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>


    <title>活动修改</title>

    <link rel="shortcut icon" href="favicon.ico"/>
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet"/>
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet"/>
    <link href="css/animate.css" rel="stylesheet"/>
    <link href="css/style.css?v=4.1.0" rel="stylesheet"/>
    <link rel="shortcut icon" href="favicon.ico"/>
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet"/>
    <link href="css/animate.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="css/plugins/simditor/simditor.css" />
    <link href="css/style.css?v=4.1.0" rel="stylesheet"/>

    <link rel="shortcut icon" href="favicon.ico"/>
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet"/>
    <link href="css/animate.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="css/plugins/webuploader/webuploader.css"/>
    <link rel="stylesheet" type="text/css" href="css/demo/webuploader-demo.css"/>
    <link href="css/style.css?v=4.1.0" rel="stylesheet"/>
</head>

<body class="gray-bg">
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h1>活动列表添加 <small></small></h1>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <form method="post" action="wl_activity_commodityInsert" class="form-horizontal" enctype="multipart/form-data">
                    <div class="form-group">
                        <!--<label class="col-sm-2 control-label">产品名称：</label>-->
                        <!--<select class="form-control m-b"  name="commodityid" style="width: 300px;">-->
                            <!--<option th:each="wl:${wl_commodity_getByCommodityNames}" th:text="${wl.commodityname}" th:value="${wl.id}"></option>-->
                        <!--</select>-->

                        <label class="col-sm-2 control-label">分类名称：</label>
                        <select required class="form-control m-b" id="goodTypesId" name="goodTypesId" onchange="change()" style="width: 300px;">
                            <option th:each="wl:${wl_category_getByCateId_List}" th:text="${wl.catename}" th:value="${wl.cateid}"></option>
                        </select>

                        <label class="col-sm-2 control-label">产品名称：</label>
                        <select required class="form-control m-b"  id="goodTypesId2" name="commodityid" style="width: 300px;">

                        </select>

                        <br/>
                        <label class="col-sm-2 control-label">活动价格：</label>
                        <input required type="number" min="0" name="cprice" class="form-control" style="width: 300px;border-radius: 4%;"/><br/>

                        <label class="col-sm-2 control-label">原价：</label>
                        <input required type="number" min="0" name="oprice" class="form-control" style="width: 300px;border-radius: 4%;"/><br/>

                        <label class="col-sm-2 control-label">是否包邮：</label>
                        <div class="form-group">
                            <div class="checkbox i-checks">
                                <label>
                                    <input type="radio" value="0"  name="hasfreight" checked="checked"/> <i></i> 不包邮</label>
                                <label>
                                    <input type="radio" value="1"  name="hasfreight" /> <i></i> 包邮</label>
                            </div>
                        </div>

                        <label class="col-sm-2 control-label">结束时间：</label>
                        <input id="riqi" onblur="inputOnBlur();" required type="date" name="expiredtime" class="form-control" style="width: 300px;border-radius: 4%;"/><br/>

                        <label class="col-sm-2 control-label">类型：</label>
                        <div class="form-group">
                            <div class="checkbox i-checks">
                                <label>
                                    <input type="radio" value="1"  name="type" checked="checked"/> <i></i> 聚划算</label>
                                <label>
                                    <input type="radio" value="2"  name="type"/> <i></i> 0元购</label>
                                <label>
                                    <input type="radio" value="3"  name="type" /> <i></i> 每周特惠</label>
                                <label>
                                    <input type="radio" value="4"  name="type" /> <i></i> 新人专区</label>
                                <label>
                                    <input type="radio" value="5"  name="type" /> <i></i> 节日活动</label>
                                <label>
                                    <input type="radio" value="6"  name="type" /> <i></i> 新品</label>
                                <label>
                                    <input type="radio" value="7"  name="type" /> <i></i> 热卖</label>
                            </div>
                        </div>

                        <label class="col-sm-2 control-label">状态：</label>
                        <div class="form-group">
                            <div class="checkbox i-checks">
                                <label>
                                    <input type="radio" value="0"  name="status" /> <i></i> 已过期</label>
                                <label>
                                    <input type="radio" value="1"  name="status" checked="checked"/> <i></i> 未过期</label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">商品描述：</label>
                        <textarea required class="col-sm-3" rows="5"  placeholder="这里输入内容" name="describe"></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">保存信息</button>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>

<script>
    function inputOnBlur() {
        var riqi = new Date(document.getElementById('riqi').value).getTime();
        var now = new Date().getTime();
        if (riqi < now) {
            alert("失效时间必须大于当前日期！");
        }
    }

    //加载默认洗下拉框
        $(function () {
            var isd = $("#goodTypesId option:first").val();
            $.ajax(
                {
                    url:'wl_commodity_getByCommodityName',
                    type:'post',
                    data:{
                        id:isd
                    },
                    dataType:'json',
                    success:function (res) {
                        var objs = eval(res); //解析json对象 
                        var option="";
                        $("[name=commodityid] option").remove();
                        for(var item in objs){
                            $("#goodTypesId2").append("<option value='"+objs[item].id+"'>"+objs[item].commodityname+"</option>");
                        }
                    }
                }
            )
        })
</script>

<!-- simditor -->
<script type="text/javascript" src="js/plugins/simditor/module.js"></script>
<script type="text/javascript" src="js/plugins/simditor/uploader.js"></script>
<script type="text/javascript" src="js/plugins/simditor/hotkeys.js"></script>
<script type="text/javascript" src="js/plugins/simditor/simditor.js"></script>
<script type="text/javascript">
    // 添加全局站点信息
    var BASE_URL = 'js/plugins/webuploader';
</script>
<script src="js/plugins/webuploader/webuploader.min.js"></script>

<script src="js/demo/webuploader-demo.js"></script>

<!-- iCheck -->
<script src="js/plugins/iCheck/icheck.min.js"></script>
<script>

    function quchu(id){
        var asd = $("#"+id+"").parent().parent().attr("id");
        $("#"+asd+"").html("");
    }

    $(document).ready(function () {
        var editor = new Simditor({
            textarea: $('#editor'),
            defaultImage: 'img/a9.jpg'
        });
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $('.summernote').summernote({
            lang: 'zh-CN'
        });
    });
    var edit = function () {
        $("#eg").addClass("no-padding");
        $('.click2edit').summernote({
            lang: 'zh-CN',
            focus: true
        });
    };
    var save = function () {
        $("#eg").removeClass("no-padding");
        var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
        $('.click2edit').destroy();
    };

    /**
     * 下拉框ajax事件
     */
    function change() {
        var isd = $("#goodTypesId").val();
        $.ajax(
            {
                url:'wl_commodity_getByCommodityName',
                type:'post',
                data:{
                    id:isd
                },
                dataType:'json',
                success:function (res) {
                    var objs = eval(res); //解析json对象 
                    var option="";
                    $("[name=commodityid] option").remove();
                    for(var item in objs){
                        $("#goodTypesId2").append("<option value='"+objs[item].id+"'>"+objs[item].commodityname+"</option>");
                    }
                }
            }
        )
    }
</script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<!--统计代码，可删除-->





</body>

</html>
